package com.community.property.service.impl;

import java.util.List;
import com.community.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.community.property.mapper.WorkOrderMapper;
import com.community.property.domain.WorkOrder;
import com.community.property.service.IWorkOrderService;

/**
 * 内部工单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-29
 */
@Service
public class WorkOrderServiceImpl implements IWorkOrderService 
{
    @Autowired
    private WorkOrderMapper workOrderMapper;

    /**
     * 查询内部工单
     * 
     * @param workOrderId 内部工单主键
     * @return 内部工单
     */
    @Override
    public WorkOrder selectWorkOrderByWorkOrderId(Long workOrderId)
    {
        return workOrderMapper.selectWorkOrderByWorkOrderId(workOrderId);
    }

    /**
     * 查询内部工单列表
     * 
     * @param workOrder 内部工单
     * @return 内部工单
     */
    @Override
    public List<WorkOrder> selectWorkOrderList(WorkOrder workOrder)
    {
        return workOrderMapper.selectWorkOrderList(workOrder);
    }

    /**
     * 新增内部工单
     * 
     * @param workOrder 内部工单
     * @return 结果
     */
    @Override
    public int insertWorkOrder(WorkOrder workOrder)
    {
        workOrder.setCreateTime(DateUtils.getNowDate());
        return workOrderMapper.insertWorkOrder(workOrder);
    }

    /**
     * 修改内部工单
     * 
     * @param workOrder 内部工单
     * @return 结果
     */
    @Override
    public int updateWorkOrder(WorkOrder workOrder)
    {
        workOrder.setUpdateTime(DateUtils.getNowDate());
        return workOrderMapper.updateWorkOrder(workOrder);
    }

    /**
     * 批量删除内部工单
     * 
     * @param workOrderIds 需要删除的内部工单主键
     * @return 结果
     */
    @Override
    public int deleteWorkOrderByWorkOrderIds(Long[] workOrderIds)
    {
        return workOrderMapper.deleteWorkOrderByWorkOrderIds(workOrderIds);
    }

    /**
     * 删除内部工单信息
     * 
     * @param workOrderId 内部工单主键
     * @return 结果
     */
    @Override
    public int deleteWorkOrderByWorkOrderId(Long workOrderId)
    {
        return workOrderMapper.deleteWorkOrderByWorkOrderId(workOrderId);
    }


}
